<?php 
require ('config.php');

$query="SELECT spell_id, name, domain, level FROM Spell ORDER BY level, name";
$res=mysql_query($query);

while ($item=mysql_fetch_assoc($res)){
	$list.='<option value="'.$item['spell_id'].'">'.$item['name'].', '.$item['domain'].', '.$item['level'].'</option>';
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
	<title>Add Spell - Dice Machine</title>
	<meta http-equiv="content-type" content="text/html;charset=utf-8" />
	</head>

<body>
<form name="input" action="save_spell.php" method="post">
Name: <select name="wizard_spell"><?php echo $list;?></select><input name="name"><br/>
Class: 
<select name="class">
	<option></option>
	<option value="2">Bard</option>
	<option value="3">Cleric</option>
	<option value="4">Druid</option>
	<option value="7">Paladin</option>
	<option value="8">Ranger</option>
	<option value="11">Wizard</option>
</select><br/>
Domain:<input name="domain" type="text"><br/>
Level: <select name="level">
<option></option>
<option>0</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
</select><br/>
Casting time: <input type="text" name="casting_time"/><br/>
Range: <input type="text" name="range"/><br/>
Effect: <input type="text" name="effect"/><br/>
Duration: <input type="text" name="duration"/><br/>
Saving throw: <input type="text" name="saving_throw"/><br/>
Spell resistance: <input type="text" name="spell_resistance"/><br/>
Die needed:
<select name="die">
<option></option>
<option>d2</option>
<option>d4</option>
<option>d6</option>
<option>d8</option>
<option>d10</option>
<option>d12</option>
<option>d20</option>
<option>d100</option>
</select>
<br/>
<input type="submit" value="submit"/>
</form>
</body>
</html>
